<?php
/* @var $this TablesController */
/* @var $model Tables */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tables-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>



	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'name'); ?>
	</div>
	<?php
	$database = Databases::model()->findAll();
	$dbs = array();
	foreach($database as $key=>$d){
		$dbs[outStr($d->id)] = $d->name;
	}
	
	?>
	<div class="row">
		<?php echo $form->labelEx($model,'database_id'); ?>
		<?php echo $form->dropDownList($model,'database_id',$dbs); ?>
		<?php echo $form->error($model,'database_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->textField($model,'status'); ?>
		<?php echo $form->error($model,'status'); ?>
		<p>Example:</p> 
		<ol>
			<li>0 - Actived </li>
			<li>1 - Missing </li>
		</ol>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->